<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen">
</head>
<body>
    <div class="entry"> 
 <ul id="toc_l"> 
  <li><strong><a href="#MathAbs">MathAbs()</a></strong> – 求绝对值 </li> 
  <li><strong><a href="#MathArccos">MathArccos()</a></strong> – 求反余弦 </li> 
  <li><strong><a href="#MathArcsin">MathArcsin()</a></strong> – 求反正弦 </li> 
  <li><strong><a href="#MathArctan">MathArctan()</a></strong> – 求反正切 </li> 
  <li><strong><a href="#MathCeil">MathCeil()</a></strong> – 取最小整数 </li> 
  <li><strong><a href="#MathCos">MathCos()</a></strong> – 求余弦 </li> 
  <li><strong><a href="#MathExp">MathExp()</a></strong> – 求e的幂 </li> 
  <li><strong><a href="#MathFloor">MathFloor()</a></strong> – 取最大整数 </li> 
  <li><strong><a href="#MathLog">MathLog()</a></strong> – 求自然对数 </li> 
  <li><strong><a href="401.html#MathMax">MathMax()</a></strong> – 求最大值 </li> 
  <li><strong><a href="401.html#MathMin">MathMin()</a></strong> – 求最小值 </li> 
  <li><strong><a href="401.html#MathMod">MathMod()</a></strong> – 求模 </li> 
  <li><strong><a href="401.html#MathPow">MathPow()</a></strong> – 求幂 </li> 
  <li><strong><a href="401.html#MathRand">MathRand()</a></strong> – 获取随机整数 </li> 
  <li><strong><a href="401.html#MathRound">MathRound()</a></strong> – 求四舍五入值 </li> 
  <li><strong><a href="401.html#MathSin">MathSin()</a></strong> – 求正弦 </li> 
  <li><strong><a href="401.html#MathSqrt">MathSqrt()</a></strong> – 求平方根 </li> 
  <li><strong><a href="401.html#MathSrand">MathSrand()</a></strong> – 随机数设置 </li> 
  <li><strong><a href="401.html#MathTan">MathTan()</a></strong> – 求正切 </li> 
 </ul> 
 <p>&nbsp;</p> 
 <h2><a name="MathAbs"></a>MathAbs() – 求绝对值</h2> 
 <pre class="brush: mql4; toolbar: false;">double MathAbs(double value)</pre> 
 <p>返回指定数值的绝对值(模数)。 </p> 
 <p>参数:</p> 
 <pre>value - 数值。</pre> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;">  double dx=-3.141593, dy;
  // calc MathAbs
  dy=MathAbs(dx);
  Print("The absolute value of ",dx," is ",dy);
  // 输入数据:  -3.141593的绝对值为3.141593</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="MathArccos"></a>MathArccos() – 求反余弦</h2> 
 <pre class="brush: mql4; toolbar: false;">double MathArccos(double x)</pre> 
 <p>MathArccos函数返回x在0~兀(用弧度)范围内的反余弦。如果x小于-1或超出1,&nbsp; MathArccos返回NaN(值不确定)。</p> 
 <p>参数:</p> 
 <pre>x - 计算的数值在-1 到 1 之间。</pre> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;">  double x=0.32696, y;
  y=MathArcsin(x);
  Print("正弦",x," = ",y);
  y=MathArccos(x);
  Print("余弦 ",x," = ",y);
  //输出: 反正弦 0.326960=0.333085
  //输出: 反余弦 0.326960=1.237711</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="MathArcsin"></a>MathArcsin() – 求反正弦</h2> 
 <pre class="brush: mql4; toolbar: false;">double MathArccos(double x)</pre> 
 <p>返回x在-兀/2到兀/2范围内反正弦。如果x小于一1或超出1，返回NaN (值不确定)。</p> 
 <p>参数:</p> 
 <pre>x - 计算的数值。</pre> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;">  double x=0.32696, y;
  y=MathArcsin(x);
  Print("正弦",x," = ",y);
  y=MathArccos(x);
  Print("余弦 ",x," = ",y);
  //输出: 反正弦 0.326960=0.333085
  //输出: 反余弦 0.326960=1.237711</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="MathArctan"></a>MathArctan() – 求反正切</h2> 
 <pre class="brush: mql4; toolbar: false;">double MathArctan(double x)</pre> 
 <p>本函数返回x的反正切值。如果x为0，返回0。返回值必须在 -兀/2 到 兀/20。</p> 
 <p>参数:</p> 
 <pre>x - 计算的数值。</pre> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;">   double x=-862.42, y;
   y=MathArctan(x);
   Print("反正切 ",x," is ",y);
  //输出数据:反正切 -862.42 是 -1.5696</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="MathCeil"></a>MathCeil() – 取最小整数</h2> 
 <pre class="brush: mql4; toolbar: false;">double MathCeil(double x)</pre> 
 <p>MathCeil函数返回一个大于或等于x的最小整数。</p> 
 <p>参数:</p> 
 <pre>x - 计算的数值。</pre> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;">  double y;
  y=MathCeil(2.8);
  Print("上限 2.8 is ",y);
  y=MathCeil(-2.8);
  Print("上限 -2.8 is ",y);
  /*输出数据:
  2.8  的最小整数 3
  -2.8 的最小整数 -2*/</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="MathCos"></a>MathCos() – 求余弦</h2> 
 <pre class="brush: mql4; toolbar: false;">double MathCos(double x)</pre> 
 <p>返回指定角度的余弦。</p> 
 <p>参数:</p> 
 <pre>x - 用弧度表示的角度值。</pre> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;">  double pi=3.1415926535;
  double x, y;
  x=pi/2;
  y=MathSin(x);
  Print("正弦(",x,") = ",y);
  y=MathCos(x);
  Print("余弦(",x,") = ",y);
  //输出数据: 正弦(1.5708)=1
  //         余弦(1.5708)=0</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="MathExp"></a>MathExp() – 求e的幂</h2> 
 <pre class="brush: mql4; toolbar: false;">double MathExp(double d)</pre> 
 <p>返回e的d次幂。在溢出情况下，函数返回工INF(无穷大)，下溢时返回0。</p> 
 <p>参数:</p> 
 <pre>d - 指定乘方的数值。</pre> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;">  double x=2.302585093,y;
  y=MathExp(x);
  Print("MathExp(",x,") = ",y);
  //输出: MathExp(2.3026)=10</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="MathFloor"></a>MathFloor() – 取最大整数</h2> 
 <pre class="brush: mql4; toolbar: false;">double MathFloor(double x)</pre> 
 <p>MathFloor函数返回一个小于或等于x的最大整数。</p> 
 <p>参数:</p> 
 <pre>x - 计算的数值。</pre> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;">  double y;
  y=MathFloor(2.8);
  Print("下限 2.8 is ",y);
  y=MathFloor(-2.8);
  Print("下限 -2.8 is ",y);
  /*输出数据:
  下限2.8  为 2
  下限 -2.8 为-3*/</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="MathLog"></a>MathLog() – 求自然对数</h2> 
 <pre class="brush: mql4; toolbar: false;">double MathLog(double x)</pre> 
 <p>如果成功，MathLog函数返回x的自然对数。如果x是负值，返回NaN(值不确定)。如果x是0，他们返回INF(无穷大)。</p> 
 <p>参数:</p> 
 <pre>x - 计算的数值。</pre> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;"> double x=9000.0,y;
 y=MathLog(x);
 Print("MathLog(",x,") = ", y);
 //输出数据: MathLog(9000)=9.10498</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 本文地址：
 <a href="400.html" rel="bookmark"><b>400.html</b></a> 
</div>
</body>
</html>